import { Rule } from "./types";

export const StyleRuleList: Rule[] = [
    {
        id: "AlsoCouldBeApply",
        descEn: `Detects when an also block contains only it-started expressions.

        By refactoring the also block to an apply block makes it so that all its can be removed thus making the block more concise and easier to read.`,
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#alsocouldbeapply",
    },
    {
        id: "CanBeNonNullable",
        descEn: `This rule inspects variables marked as nullable and reports which could be declared as non-nullable instead.

        It's preferred to not have functions that do "nothing". A function that does nothing when the value is null hides the logic, so it should not allow null values in the first place. It is better to move the null checks up around the calls, instead of having it inside the function.
        
        This could lead to less nullability overall in the codebase.`,
        descCn: "",
        active: false,
        debt: "10min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#canbenonnullable",
    },
    {
        id: "CascadingCallWrapping",
        descEn: "Requires that all chained calls are placed on a new line if a preceding one is.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#cascadingcallwrapping",
    },
    {
        id: "ClassOrdering",
        descEn: `This rule ensures class contents are ordered as follows as recommended by the Kotlin Coding Conventions:

        Property declarations and initializer blocks
        Secondary constructors
        Method declarations
        Companion object`,
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#classordering",
    },
    {
        id: "CollapsibleIfStatements",
        descEn: `This rule detects if statements which can be collapsed. This can reduce nesting and help improve readability.

        However, carefully consider whether merging the if statements actually improves readability, as collapsing the statements may hide some edge cases from the reader.`,
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#collapsibleifstatements",
    },
    {
        id: "DataClassContainsFunctions",
        descEn: `This rule reports functions inside data classes which have not been marked as a conversion function.

        Data classes should mainly be used to store data. This rule assumes that they should not contain any extra functions aside functions that help with converting objects from/to one another. Data classes will automatically have a generated equals, toString and hashCode function by the compiler.`,
        descCn: "",
        active: false,
        debt: "20min",
        paramList: [
            {
                param: "conversionFunctionPrefix",
                descEn: "allowed conversion function names",
                descCn: "",
                defaultValue: ['to'],
            }
        ],
        url: "https://detekt.dev/docs/rules/style#dataclasscontainsfunctions",
    },
    {
        id: "DataClassShouldBeImmutable",
        descEn: `This rule reports mutable properties inside data classes.

        Data classes should mainly be used to store immutable data. This rule assumes that they should not contain any mutable properties.`,
        descCn: "",
        active: false,
        debt: "20min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#dataclassshouldbeimmutable",
    },
    {
        id: "DestructuringDeclarationWithTooManyEntries",
        descEn: "Destructuring declarations with too many entries are hard to read and understand. To increase readability they should be refactored to reduce the number of entries or avoid using a destructuring declaration.",
        descCn: "",
        active: true,
        debt: "10min",
        paramList: [
            {
                param: "maxDestructuringEntries",
                descEn: "maximum allowed elements in a destructuring declaration",
                descCn: "",
                defaultValue: 3,
            }
        ],
        url: "https://detekt.dev/docs/rules/style#destructuringdeclarationwithtoomanyentries",
    },
    {
        id: "EqualsNullCall",
        descEn: "To compare an object with null prefer using ==. This rule detects and reports instances in the code where the equals() method is used to compare a value with null.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#equalsnullcall",
    },
    {
        id: "EqualsOnSignatureLine",
        descEn: "Requires that the equals sign, when used for an expression style function, is on the same line as the rest of the function signature.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#equalsonsignatureline",
    },
    {
        id: "ExplicitCollectionElementAccessMethod",
        descEn: "In Kotlin functions get or set can be replaced with the shorter operator — [], see Indexed access operator. Prefer the usage of the indexed access operator [] for map or list element access or insert methods.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#explicitcollectionelementaccessmethod",
    },
    {
        id: "ExplicitItLambdaParameter",
        descEn: "Lambda expressions are one of the core features of the language. They often include very small chunks of code using only one parameter. In this cases Kotlin can supply the implicit it parameter to make code more concise. It fits most use cases, but when faced larger or nested chunks of code, you might want to add an explicit name for the parameter. Naming it just it is meaningless and only makes your code misleading, especially when dealing with nested functions.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#explicititlambdaparameter",
    },
    {
        id: "ExpressionBodySyntax",
        descEn: "Functions which only contain a return statement can be collapsed to an expression body. This shortens and cleans up the code.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [
            {
                param: "includeLineWrapping",
                descEn: "include return statements with line wraps in it",
                descCn: "",
                defaultValue: false,
            }
        ],
        url: "https://detekt.dev/docs/rules/style#expressionbodysyntax",
    },
    {
        id: "ForbiddenComment",
        descEn: "This rule allows to set a list of comments which are forbidden in the codebase and should only be used during development. Offending code comments will then be reported.",
        descCn: "",
        active: true,
        debt: "10min",
        paramList: [
            {
                param: "values",
                descEn: "forbidden comment strings",
                descCn: "",
                defaultValue: ['FIXME:', 'STOPSHIP:', 'TODO:'],
            },
            {
                param: "allowedPatterns",
                descEn: "ignores comments which match the specified regular expression. For example Ticket|Task.",
                descCn: "",
                defaultValue: "",
            },
            {
                param: "",
                descEn: "error message which overrides the default one",
                descCn: "",
                defaultValue: "",
            },
        ],
        url: "https://detekt.dev/docs/rules/style#forbiddencomment",
    },
    {
        id: "ForbiddenImport",
        descEn: "This rule allows to set a list of forbidden imports. This can be used to discourage the use of unstable, experimental or deprecated APIs. Detekt will then report all imports that are forbidden.",
        descCn: "",
        active: false,
        debt: "10min",
        paramList: [
            {
                param: "imports",
                descEn: "imports which should not be used",
                descCn: "",
                defaultValue: [],
            },
            {
                param: "forbiddenPatterns",
                descEn: "reports imports which match the specified regular expression. For example net.*R.",
                descCn: "",
                defaultValue: '',
            },
        ],
        url: "https://detekt.dev/docs/rules/style#forbiddenimport",
    },
    {
        id: "ForbiddenMethodCall",
        descEn: "This rule allows to set a list of forbidden methods or constructors. This can be used to discourage the use of unstable, experimental or deprecated methods, especially for methods imported from external libraries. Detekt will then report all method or constructor invocations that are forbidden.",
        descCn: "",
        active: false,
        debt: "10min",
        paramList: [
            {
                param: "methods",
                descEn: "List of fully qualified method signatures which are forbidden. Methods can be defined without full signature (i.e. java.time.LocalDate.now) which will report calls of all methods with this name or with full signature (i.e. java.time.LocalDate(java.time.Clock)) which would report only call with this concrete signature. If you want to forbid an extension function like fun String.hello(a: Int) you should add the receiver parameter as the first parameter like this: hello(kotlin.String, kotlin.Int). To forbid constructor calls you need to define them with <init>, for example java.util.Date.<init>. To forbid calls involving type parameters, omit them, for example fun hello(args: Array<Any>) is referred to as simply hello(kotlin.Array) (also the signature for vararg parameters). To forbid methods from the companion object reference the Companion class, for example as TestClass.Companion.hello() (even if it is marked @JvmStatic).",
                descCn: "",
                defaultValue: ['kotlin.io.print', 'kotlin.io.println'],
            }
        ],
        url: "https://detekt.dev/docs/rules/style#forbiddenmethodcall",
    },
    {
        id: "ForbiddenSuppress",
        descEn: "This rule allows to set a list of rules whose suppression is forbidden. This can be used to discourage the abuse of the Suppress and SuppressWarnings annotations. Detekt will report suppression of all forbidden rules. This rule is not capable of reporting suppression of itself, as that's a language feature with precedence.",
        descCn: "",
        active: false,
        debt: "10min",
        paramList: [
            {
                param: "rules",
                descEn: "Rules whose suppression is forbidden.",
                descCn: "",
                defaultValue: [],
            }
        ],
        url: "https://detekt.dev/docs/rules/style#forbiddensuppress",
    },
    {
        id: "ForbiddenVoid",
        descEn: "This rule detects usages of Void and reports them as forbidden. The Kotlin type Unit should be used instead. This type corresponds to the Void class in Java and has only one value - the Unit object.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "ignoreOverridden",
                descEn: "ignores void types in signatures of overridden functions",
                descCn: "",
                defaultValue: false,
            },
            {
                param: "ignoreUsageInGenerics",
                descEn: "ignore void types as generic arguments",
                descCn: "",
                defaultValue: false,
            },
        ],
        url: "https://detekt.dev/docs/rules/style#forbiddenvoid",
    },
    {
        id: "FunctionOnlyReturningConstant",
        descEn: "A function that only returns a single constant can be misleading. Instead, prefer declaring the constant as a const val.",
        descCn: "",
        active: true,
        debt: "10min",
        paramList: [
            {
                param: "ignoreOverridableFunction",
                descEn: "if overriden functions should be ignored",
                descCn: "",
                defaultValue: true,
            },
            {
                param: "ignoreActualFunction",
                descEn: "if actual functions should be ignored",
                descCn: "",
                defaultValue: true,
            },
            {
                param: "excludedFunctions",
                descEn: "excluded functions",
                descCn: "",
                defaultValue: [],
            },
            {
                param: "ignoreAnnotated",
                descEn: "allows to provide a list of annotations that disable this check",
                descCn: "",
                defaultValue: []
            }
        ],
        url: "https://detekt.dev/docs/rules/style#functiononlyreturningconstant",
    },
    {
        id: "LoopWithTooManyJumpStatements",
        descEn: "Loops which contain multiple break or continue statements are hard to read and understand. To increase readability they should be refactored into simpler loops.",
        descCn: "",
        active: true,
        debt: "10min",
        paramList: [
            {
                param: "maxJumpCount",
                descEn: "maximum allowed jumps in a loop",
                descCn: "",
                defaultValue: 1,
            }
        ],
        url: "https://detekt.dev/docs/rules/style#loopwithtoomanyjumpstatements",
    },
    {
        id: "MagicNumber",
        descEn: "This rule detects and reports usages of magic numbers in the code. Prefer defining constants with clear names describing what the magic number means.",
        descCn: "",
        active: true,
        debt: "10min",
        paramList: [
            {
                param: "ignoreNumbers",
                descEn: "numbers which do not count as magic numbers",
                descCn: "",
                defaultValue: ['-1', '0', '1', '2'],
            },
            {
                param: "ignoreHashCodeFunction",
                descEn: "whether magic numbers in hashCode functions should be ignored",
                descCn: "",
                defaultValue: true,
            },
            {
                param: "ignorePropertyDeclaration",
                descEn: "whether magic numbers in property declarations should be ignored",
                descCn: "",
                defaultValue: false,
            },
            {
                param: "ignoreLocalVariableDeclaration",
                descEn: "whether magic numbers in local variable declarations should be ignored",
                descCn: "",
                defaultValue: false,
            },
            {
                param: "ignoreConstantDeclaration",
                descEn: "whether magic numbers in constant declarations should be ignored",
                descCn: "",
                defaultValue: true,
            },
            {
                param: "ignoreCompanionObjectPropertyDeclaration",
                descEn: "whether magic numbers in companion object declarations should be ignored",
                descCn: "",
                defaultValue: true,
            },
            {
                param: "ignoreAnnotation",
                descEn: "whether magic numbers in annotations should be ignored",
                descCn: "",
                defaultValue: false,
            },
            {
                param: "ignoreNamedArgument",
                descEn: "whether magic numbers in named arguments should be ignored",
                descCn: "",
                defaultValue: true,
            },
            {
                param: "ignoreEnums",
                descEn: "whether magic numbers in enums should be ignored",
                descCn: "",
                defaultValue: false,
            },
            {
                param: "ignoreRanges",
                descEn: "whether magic numbers in ranges should be ignored",
                descCn: "",
                defaultValue: false,
            },
            {
                param: "ignoreExtensionFunctions",
                descEn: "whether magic numbers as subject of an extension function should be ignored",
                descCn: "",
                defaultValue: true,
            },
        ],
        url: "https://detekt.dev/docs/rules/style#magicnumber",
    },
    {
        id: "MandatoryBracesIfStatements",
        descEn: "This rule detects multi-line if statements which do not have braces. Adding braces would improve readability and avoid possible errors.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#mandatorybracesifstatements",
    },
    {
        id: "MandatoryBracesLoops",
        descEn: "This rule detects multi-line for and while loops which do not have braces. Adding braces would improve readability and avoid possible errors.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#mandatorybracesloops",
    },
    {
        id: "MaxChainedCallsOnSameLine",
        descEn: "Limits the number of chained calls which can be placed on a single line.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [
            {
                param: "maxChainedCalls",
                descEn: "maximum chained calls allowed on a single line",
                descCn: "",
                defaultValue: 5,
            }
        ],
        url: "https://detekt.dev/docs/rules/style#maxchainedcallsonsameline",
    },
    {
        id: "MaxLineLength",
        descEn: `This rule reports lines of code which exceed a defined maximum line length.

        Long lines might be hard to read on smaller screens or printouts. Additionally, having a maximum line length in the codebase will help make the code more uniform.`,
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "maxLineLength",
                descEn: "maximum line length",
                descCn: "",
                defaultValue: 120,
            },
            {
                param: "excludePackageStatements",
                descEn: "if package statements should be ignored",
                descCn: "",
                defaultValue: true,
            },
            {
                param: "excludeImportStatements",
                descEn: "if import statements should be ignored",
                descCn: "",
                defaultValue: true,
            },
            {
                param: "excludeCommentStatements",
                descEn: "if comment statements should be ignored",
                descCn: "",
                defaultValue: false,
            },
            {
                param: "excludeRawStrings",
                descEn: "if raw strings should be ignored",
                descCn: "",
                defaultValue: true,
            },
        ],
        url: "https://detekt.dev/docs/rules/style#maxlinelength",
    },
    {
        id: "MayBeConst",
        descEn: "This rule identifies and reports properties (val) that may be const val instead. Using const val can lead to better performance of the resulting bytecode as well as better interoperability with Java.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#maybeconst",
    },
    {
        id: "ModifierOrder",
        descEn: "This rule reports cases in the code where modifiers are not in the correct order. ",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#modifierorder",
    },
    {
        id: "MultilineLambdaItParameter",
        descEn: "Lambda expressions are very useful in a lot of cases, and they often include very small chunks of code using only one parameter. In this cases Kotlin can supply the implicit it parameter to make code more concise. However, when you are dealing with lambdas that contain multiple statements, you might end up with code that is hard to read if you don't specify a readable, descriptive parameter name explicitly.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#multilinelambdaitparameter",
    },
    {
        id: "MultilineRawStringIndentation",
        descEn: `This rule ensures that raw strings have a consistent indentation.

        The content of a multi line raw string should have the same indentation as the enclosing expression plus the configured indentSize. The closing triple-quotes (""") must have the same indentation as the enclosing expression.`,
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [
            {
                param: "indentSize",
                descEn: "indentation size",
                descCn: "",
                defaultValue: 4,
            }
        ],
        url: "https://detekt.dev/docs/rules/style#multilinerawstringindentation",
    },
    {
        id: "NestedClassesVisibility",
        descEn: "Nested classes inherit their visibility from the parent class and are often used to implement functionality local to the class it is nested in. These nested classes can't have a higher visibility than their parent. However, the visibility can be further restricted by using a private modifier for instance. In internal classes the explicit public modifier for nested classes is misleading and thus unnecessary, because the nested class still has an internal visibility.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#nestedclassesvisibility",
    },
    {
        id: "NewLineAtEndOfFile",
        descEn: "This rule reports files which do not end with a line separator.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#newlineatendoffile",
    },
    {
        id: "NoTabs",
        descEn: "This rule reports if tabs are used in Kotlin files. According to Google's Kotlin style guide the only whitespace chars that are allowed in a source file are the line terminator sequence and the ASCII horizontal space character (0x20). Strings containing tabs are allowed.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#notabs",
    },
    {
        id: "NullableBooleanCheck",
        descEn: `Detects nullable boolean checks which use an elvis expression ?: rather than equals ==.

        Per the Kotlin coding conventions converting a nullable boolean property to non-null should be done via != false or == true rather than ?: true or ?: false (respectively).`,
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#nullablebooleancheck",
    },
    {
        id: "ObjectLiteralToLambda",
        descEn: "An anonymous object that does nothing other than the implementation of a single method can be used as a lambda.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#objectliteraltolambda",
    },
    {
        id: "OptionalAbstractKeyword",
        descEn: "This rule reports abstract modifiers which are unnecessary and can be removed.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#optionalabstractkeyword",
    },
    {
        id: "OptionalUnit",
        descEn: "It is not necessary to define a return type of Unit on functions or to specify a lone Unit statement. This rule detects and reports instances where the Unit return type is specified on functions and the occurrences of a lone Unit statement.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#optionalunit",
    },
    {
        id: "OptionalWhenBraces",
        descEn: "This rule reports unnecessary braces in when expressions. These optional braces should be removed.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#optionalwhenbraces",
    },
    {
        id: "PreferToOverPairSyntax",
        descEn: "This rule detects the usage of the Pair constructor to create pairs of values.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#prefertooverpairsyntax",
    },
    {
        id: "ProtectedMemberInFinalClass",
        descEn: "Kotlin classes are final by default. Thus classes which are not marked as open should not contain any protected members. Consider using private or internal modifiers instead.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#protectedmemberinfinalclass",
    },
    {
        id: "RedundantExplicitType",
        descEn: "Local properties do not need their type to be explicitly provided when the inferred type matches the explicit type.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#redundantexplicittype",
    },
    {
        id: "RedundantHigherOrderMapUsage",
        descEn: "Redundant maps add complexity to the code and accomplish nothing. They should be removed or replaced with the proper operator.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#redundanthigherordermapusage",
    },
    {
        id: "RedundantVisibilityModifierRule",
        descEn: "This rule checks for redundant visibility modifiers. One exemption is the explicit API mode In this mode, the visibility modifier should be defined explicitly even if it is public. Hence, the rule ignores the visibility modifiers in explicit API mode.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#redundantvisibilitymodifierrule",
    },
    {
        id: "ReturnCount",
        descEn: `Restrict the number of return methods allowed in methods.

        Having many exit points in a function can be confusing and impacts readability of the code.`,
        descCn: "",
        active: true,
        debt: "10min",
        paramList: [
            {
                param: "max",
                descEn: "define the maximum number of return statements allowed per function",
                descCn: "",
                defaultValue: 2,
            },
            {
                param: "excludedFunctions",
                descEn: "define a list of function names to be ignored by this check",
                descCn: "",
                defaultValue: ['equals'],
            },
            {
                param: "excludeLabeled",
                descEn: "if labeled return statements should be ignored",
                descCn: "",
                defaultValue: false,
            },
            {
                param: "excludeReturnFromLambda",
                descEn: "if labeled return from a lambda should be ignored",
                descCn: "",
                defaultValue: true,
            },
            {
                param: "excludeGuardClauses",
                descEn: "if true guard clauses at the beginning of a method should be ignored",
                descCn: "",
                defaultValue: false,
            },
        ],
        url: "https://detekt.dev/docs/rules/style#returncount",
    },
    {
        id: "SafeCast",
        descEn: "This rule inspects casts and reports casts which could be replaced with safe casts instead.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#safecast",
    },
    {
        id: "SerialVersionUIDInSerializableClass",
        descEn: "Classes which implement the Serializable interface should also correctly declare a serialVersionUID. This rule verifies that a serialVersionUID was correctly defined.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#serialversionuidinserializableclass",
    },
    {
        id: "SpacingBetweenPackageAndImports",
        descEn: "This rule verifies spacing between package and import statements as well as between import statements and class declarations.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#spacingbetweenpackageandimports",
    },
    {
        id: "ThrowsCount",
        descEn: "Functions should have clear throw statements. Functions with many throw statements can be harder to read and lead to confusion. Instead, prefer limiting the number of throw statements in a function.",
        descCn: "",
        active: true,
        debt: "10min",
        paramList: [
            {
                param: "max",
                descEn: "maximum amount of throw statements in a method",
                descCn: "",
                defaultValue: 2,
            },
            {
                param: "excludeGuardClauses",
                descEn: "if set to true, guard clauses do not count towards the allowed throws count",
                descCn: "",
                defaultValue: false,
            },
        ],
        url: "https://detekt.dev/docs/rules/style#throwscount",
    },
    {
        id: "TrailingWhitespace",
        descEn: "This rule reports lines that end with a whitespace.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#trailingwhitespace",
    },
    {
        id: "TrimMultilineRawString",
        descEn: "All the Raw strings that have more than one line should be followed by trimMargin() or trimIndent().",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#trimmultilinerawstring",
    },
    {
        id: "UnderscoresInNumericLiterals",
        descEn: "This rule detects and reports long base 10 numbers which should be separated with underscores for readability. For Serializable classes or objects, the field serialVersionUID is explicitly ignored. For floats and doubles, anything to the right of the decimal point is ignored.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [
            {
                param: "acceptableLength",
                descEn: "Maximum number of consecutive digits that a numeric literal can have without using an underscore",
                descCn: "",
                defaultValue: 4,
            },
            {
                param: "allowNonStandardGrouping",
                descEn: "If set to false, groups of exactly three digits must be used. If set to true, 100_00 is allowed.",
                descCn: "",
                defaultValue: false,
            },
        ],
        url: "https://detekt.dev/docs/rules/style#underscoresinnumericliterals",
    },
    {
        id: "UnnecessaryAbstractClass",
        descEn: "This rule inspects abstract classes. In case an abstract class does not have any concrete members it should be refactored into an interface. Abstract classes which do not define any abstract members should instead be refactored into concrete classes.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "ignoreAnnotated",
                descEn: "Allows you to provide a list of annotations that disable this check.",
                descCn: "",
                defaultValue: [],
            }
        ],
        url: "https://detekt.dev/docs/rules/style#unnecessaryabstractclass",
    },
    {
        id: "UnnecessaryAnnotationUseSiteTarget",
        descEn: "This rule inspects the use of the Annotation use-site Target. In case that the use-site Target is not needed it can be removed.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#unnecessaryannotationusesitetarget",
    },
    {
        id: "UnnecessaryApply",
        descEn: "apply expressions are used frequently, but sometimes their usage should be replaced with an ordinary method/extension function call to reduce visual complexity",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#unnecessaryapply",
    },
    {
        id: "UnnecessaryBackticks",
        descEn: "This rule reports unnecessary backticks.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#unnecessarybackticks",
    },
    {
        id: "UnnecessaryFilter",
        descEn: "Unnecessary filters add complexity to the code and accomplish nothing. They should be removed.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#unnecessaryfilter",
    },
    {
        id: "UnnecessaryInheritance",
        descEn: "This rule reports unnecessary super types. Inheriting from Any or Object is unnecessary and should simply be removed.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#unnecessaryinheritance",
    },
    {
        id: "UnnecessaryInnerClass",
        descEn: "This rule reports unnecessary inner classes. Nested classes that do not access members from the outer class do not require the inner qualifier.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#unnecessaryinnerclass",
    },
    {
        id: "UnnecessaryLet",
        descEn: "let expressions are used extensively in our code for null-checking and chaining functions, but sometimes their usage should be replaced with an ordinary method/extension function call to reduce visual complexity.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#unnecessarylet",
    },
    {
        id: "UnnecessaryParentheses",
        descEn: "This rule reports unnecessary parentheses around expressions. These unnecessary parentheses can safely be removed.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "allowForUnclearPrecedence",
                descEn: "allow parentheses when not strictly required but precedence may be unclear, such as (a && b) || c",
                descCn: "",
                defaultValue: false,
            }
        ],
        url: "https://detekt.dev/docs/rules/style#unnecessaryparentheses",
    },
    {
        id: "UntilInsteadOfRangeTo",
        descEn: "Reports calls to '..' operator instead of calls to 'until'. 'until' is applicable in cases where the upper range value is described as some value subtracted by 1. 'until' helps to prevent off-by-one errors.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#untilinsteadofrangeto",
    },
    {
        id: "UnusedImports",
        descEn: "This rule reports unused imports. Unused imports are dead code and should be removed. Exempt from this rule are imports resulting from references to elements within KDoc and from destructuring declarations (componentN imports).",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#unusedimports",
    },
    {
        id: "UnusedPrivateClass",
        descEn: "Reports unused private classes. If private classes are unused they should be removed. Otherwise, this dead code can lead to confusion and potential bugs.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#unusedprivateclass",
    },
    {
        id: "UnusedPrivateMember",
        descEn: "Reports unused private properties, function parameters and functions. If these private elements are unused they should be removed. Otherwise, this dead code can lead to confusion and potential bugs.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "allowedNames",
                descEn: "unused private member names matching this regex are ignored",
                descCn: "",
                defaultValue: "(_|ignored|expected|serialVersionUID)",
            }
        ],
        url: "https://detekt.dev/docs/rules/style#unusedprivatemember",
    },
    {
        id: "UseAnyOrNoneInsteadOfFind",
        descEn: "Turn on this rule to flag find calls for null check that can be replaced with a any or none call.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#useanyornoneinsteadoffind",
    },
    {
        id: "UseArrayLiteralsInAnnotations",
        descEn: "This rule detects annotations which use the arrayOf(...) syntax instead of the array literal [...] syntax. The latter should be preferred as it is more readable.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#usearrayliteralsinannotations",
    },
    {
        id: "UseCheckNotNull",
        descEn: "Turn on this rule to flag check calls for not-null check that can be replaced with a checkNotNull call.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#usechecknotnull",
    },
    {
        id: "UseCheckOrError",
        descEn: "Kotlin provides a concise way to check invariants as well as pre- and post-conditions. Prefer them instead of manually throwing an IllegalStateException.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#usecheckorerror",
    },
    {
        id: "UseDataClass",
        descEn: "Classes that simply hold data should be refactored into a data class. Data classes are specialized to hold data and generate hashCode, equals and toString implementations as well.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [
            {
                param: "ignoreAnnotated",
                descEn: "allows to provide a list of annotations that disable this check",
                descCn: "",
                defaultValue: [],
            },
            {
                param: "allowVars",
                descEn: "allows to relax this rule in order to exclude classes that contains one (or more) vars",
                descCn: "",
                defaultValue: false,
            }
        ],
        url: "https://detekt.dev/docs/rules/style#usedataclass",
    },
    {
        id: "UseEmptyCounterpart",
        descEn: `Instantiation of an object's "empty" state should use the object's "empty" initializer for clarity purposes.`,
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#useemptycounterpart",
    },
    {
        id: "UseIfEmptyOrIfBlank",
        descEn: "This rule detects isEmpty or isBlank calls to assign a default value. They can be replaced with ifEmpty or ifBlank calls.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#useifemptyorifblank",
    },
    {
        id: "UseIfInsteadOfWhen",
        descEn: "Binary expressions are better expressed using an if expression than a when expression.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#useifinsteadofwhen",
    },
    {
        id: "UseIsNullOrEmpty",
        descEn: "This rule detects null or empty checks that can be replaced with isNullOrEmpty() call.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#useisnullorempty",
    },
    {
        id: "UseOrEmpty",
        descEn: "This rule detects ?: emptyList() that can be replaced with orEmpty() call.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#useorempty",
    },
    {
        id: "UseRequire",
        descEn: "Kotlin provides a much more concise way to check preconditions than to manually throw an IllegalArgumentException.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#userequire",
    },
    {
        id: "UseRequireNotNull",
        descEn: "Turn on this rule to flag require calls for not-null check that can be replaced with a requireNotNull call.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#userequirenotnull",
    },
    {
        id: "UseSumOfInsteadOfFlatMapSize",
        descEn: "Turn on this rule to flag flatMap and size/count calls that can be replaced with a sumOf call.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#usesumofinsteadofflatmapsize",
    },
    {
        id: "UselessCallOnNotNull",
        descEn: "The Kotlin stdlib provides some functions that are designed to operate on references that may be null. These functions can also be called on non-nullable references or on collections or sequences that are known to be empty - the calls are redundant in this case and can be removed or should be changed to a call that does not check whether the value is null or not.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#uselesscallonnotnull",
    },
    {
        id: "UtilityClassWithPublicConstructor",
        descEn: "A class which only contains utility variables and functions with no concrete implementation can be refactored into an object or a class with a non-public constructor. Furthermore, this rule reports utility classes which are not final.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/style#utilityclasswithpublicconstructor",
    },
    {
        id: "VarCouldBeVal",
        descEn: "Reports var declarations (both local variables and private class properties) that could be val, as they are not re-assigned. Val declarations are assign-once (read-only), which makes understanding the current state easier.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "ignoreLateinitVar",
                descEn: "Whether to ignore uninitialized lateinit vars",
                descCn: "",
                defaultValue: false,
            }
        ],
        url: "https://detekt.dev/docs/rules/style#varcouldbeval",
    },
    {
        id: "WildcardImport",
        descEn: `Wildcard imports should be replaced with imports using fully qualified class names. This helps increase clarity of which classes are imported and helps prevent naming conflicts.

        Library updates can introduce naming clashes with your own classes which might result in compilation errors.`,
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "excludeImports",
                descEn: "Define a list of package names that should be allowed to be imported with wildcard imports.",
                descCn: "",
                defaultValue: ['java.util.*'],
            }
        ],
        url: "https://detekt.dev/docs/rules/style#wildcardimport",
    },
];